<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
	<title>哈喽妹子网_妹子,美女,美空,写真|哈喽妹子网_丝袜,性感,魅惑,车模</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="keywords" content="mm,美女,妹妹" /> 
	<meta name="description" content="哈喽妹子网,妹子,美女,美空,写真，丝袜,性感,魅惑,车模。" /> 
	<meta name="viewport" content="width=device-width, initial-scale=1.0">

	<!-- Styles
	================================================== -->	
	<link href="statics/bootstrap/css/bootstrap.css" rel="stylesheet">
	<link href="statics/css/font-awesome.css" rel="stylesheet">
	<link href="statics/css/app.css" rel="stylesheet">
	
	<!-- Google Fonts
	================================================== -->
	<link rel="stylesheet" href="statics/css/css-family=PT+Sans-300,400,400italic,700.css">
	<link rel="stylesheet" href="statics/css/css-family=Ubuntu-300,400,400italic,700.css">	
	
	<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
	<script src="statics/js/html5.js"></script>
	<![endif]-->

	</head>
<body>
	
<!-- Page Wrapper
================================================== -->
<div id="wrap" class="page">

<!-- Navbar
================================================== -->
<jsp:include page="include/navbar.jsp" />

<!-- Home Container
================================================== -->
<div id="home">
	<div class="container">
	
		<!-- Content Block
		================================================== -->
		<div id="container" class="row">
			<c:forEach items="${dp.list}" var="e">
				<div class="span3">
					<div class="itemBox">
						<div class="itemInfo"><a href="details.do?id=${e.id}" alt="${e.name}" target="_blank"><img src="${e.remark}/460"></a></div>
						<div class="itemDesc"><a href="details.do?id=${e.id}" title="${e.name}" target="_blank">${e.name}</a></div>
					</div>
				</div>
			</c:forEach>
		</div>
		
		<c:if test="${dp.pageNo<dp.pageCount}">
			<div id="next_page" class="text-center">
				<a pageNo="${dp.pageNo}" href="index.do?pageNo=${dp.pageNo+1}&pageSize=${dp.pageSize}">
					<h1 class="title" style="color:#ccc;">查看更多</h1>
				</a>
			</div>
		</c:if>
	</div><!-- End container -->	
</div><!-- End home ID -->

</div>
<!-- End Page Wrapper -->

<!-- Footer
================================================== -->
<jsp:include page="include/footer.jsp" />
<jsp:include page="include/footer_sub.jsp" />

<!-- Javascript
================================================== -->
<script src="statics/js/jquery-1.7.1.min.js"></script>
<script src="statics/bootstrap/js/bootstrap.min.js"></script>
<script src="statics/js/jquery.masonry.min.js"></script>
<script>
$(function () {
	var $container = $("#container");
	$container.imagesLoaded(function () {
		$container.masonry({itemSelector:".span3"});
	});
	
	var loading=false;
	$(window).bind("scroll", function () {
		pageNo = $("#next_page a").attr("pageNo");
		if ($(document).scrollTop() + $(window).height() > $(document).height() - 300 && !loading && pageNo>0 && pageNo%10!=0) {
			loading=true;
			$.ajax({
				url:$("#next_page a").attr("href"), 
				type:"GET", 
				success:function (data) {
					next = $(data).find("#next_page a");
					$("#next_page").html(next);
					box = $(data).find("#container .span3");
					$("#container").append(box);
					$newElems = box;
					$newElems.imagesLoaded(function () {
						$container.masonry("appended", $newElems, true);
						loading=false;
					});
				}
			});
		}
	});
});
</script>
</body> 	
</html>